All Questions
9 questions
1vote
5answers
1kviews
Replace hyphen(s) with underscore(s) within angle brackets in a file
I’m aware of how to replace string; e.g., replace hyphen with underscore in a file. However, I wish to replace all hyphens with underscore for all text that falls within angle brackets in a given file....
-1votes
2answers
76views
sed command succesfuly find and replace in file , bit erasing everything in the new file
i have this xml text in file named test2.txt <This is a line of text with a year=2020 month=12 in it This line of text does not have a year or month in it This year=2021 is the current year the ...
3votes
1answer
5kviews
how to output html to a file with xmllint?
How do I get xmllint to output to a file? thufir@dur:~/xmllint$ thufir@dur:~/xmllint$ xmllint --html http://www.skynet.be/nieuws-sport/weer/mijn-weer?cityId=6450 --xpath '//div[@class = "tides"]' - ...
0votes
1answer
466views
Get the xml nodes where the search text is found
I having a well formatted and Indented xml similar to the below one. I need to get the mono tags which has a text " http://yahoo.com " <root> <mono id="1"> <tag1>http://google.com&...
1vote
4answers
8kviews
find xml file that contain specific tag name and print the words between tag name
we can find xml file type as the follwing find /tmp/ -type f -name '*.xml' but how to change the syntax in order to find only xml that contain with: <Name>some words</Name> and print ...
6votes
5answers
9kviews
How to add an attribute in a tag in XML file by command-line?
I am trying to add field at the end of tag using sed script. Suppose I have a tag in XML file: <book name="Sed tutorial" price="250"/> Now I want to add field as Book_Width="A" after end of <...
1vote
1answer
401views
How do I synchronize 2 xml files?
I have 2 xml files named 1k.xml and 1n.xml. The file 1k.xml contains some additional elements and data which are not there in 1n.xml. I want to copy whatever is absent in 1n.xml to it, so that both ...
1vote
1answer
1kviews
Openbox Syntax Error in ~/.config/openbox/rc.xml [closed]
I added a new keybinding to my rc.xml and now I get this message every time I log into Openbox. Also, the right-click menu does not work anymore either. Now I would have fixed the error myself, but ...
7votes
1answer
711views
How can I split Openbox `rc.xml` into multiple files?
I don't like big text configuration files. So, I would like to split my rc.xml file into multiple files: rc.xml rc.keyboard.xml rc.mouse.xml